package org.laow.test.eureka.controller;

import org.laow.test.eureka.service.UploadService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestPart;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

/**
* @className   : UploadController
* @Description : TODO
* @author      : Wacky
* @date        : 2020/12/19 17:04
*/
@RestController
public class UploadController {

	@Autowired
	private UploadService uploadService;

	@PostMapping(value="/uploadFile", consumes = MediaType.MULTIPART_FORM_DATA_VALUE)
	public String handFileUpload(@RequestPart(value="file")MultipartFile file) {
		return uploadService.handleFileUpload(file);
	}

}
